/*
 * Spectrum-lib
 * Copyright (C) 2011 Benjamin Mort
 *
 * This library is free software; you can redistribute it and/or modify it
 * under terms of the Spectrum-lib Licence, Version 1.0
 */

#ifndef SPECTRUM_GLOBAL_H_
#define SPECTRUM_GLOBAL_H_

/**
 * @file spectrum_global.h
 */

#define SPECTRUM_VERSION_STR "0.0.0"

// SPECTRUM_VERSION is (major << 16) + (minor << 8) + patch
#define SPECTRUM_VERSION     0x000000

// can be used like #if (SPECTRUM_VERSION >= SPECTRUM_VERSION_CHECK(0, 0, 0))
#define SPECTRUM_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))

// Operating system. Set to SPECTRUM_OS_x where x is:
//    DARWIN - Darwin OS
//    WIN32  - Win32 (Windows 2000/XP/Vista7 and Windows Server 2003/2008)
//    LINUX  - Linux
#if defined(__APPLE__) && (defined(___GNUC__) || defined(__xlC__) || defined(__xlc__))
#  define SPECTRUM_OS_DARWIN
#elif defined(_WIN32) || defined(WIN64) || defined(__WIN64__) || defined(__WIN32__) && !defined(WINCE)
#  define SPECTRUM_OS_WIN32
#elif defined(__linux__) || defined(__linux)
# define SPECTRUM_OS_LINUX
#else
#  error "Spectrum-lib has not been ported to this OS."
#endif


// Windows DLL export macro.
#if SPECTRUM_OS_WIN
#  ifndef SPECTRUM_EXPORT
#    define SPECTRUM_EXPORT __declspec(dllexport)
#  endif
#endif

// Define SPECTRUM_EXPORT to empty when not required.
#ifndef SPECTRUM_EXPORT
#define SPECTRUM_EXPORT
#endif

#endif // SPECTRUM_GLOBAL_H_
